Handle.setSizeCallback

Sets the sizing function for the @handle, which can be used to override the size that librsvg computes for SVG images. The @size_func is called from the following functions:

* [method@Rsvg.Handle.get_dimensions] * [method@Rsvg.Handle.get_dimensions_sub] * [method@Rsvg.Handle.get_position_sub] * [method@Rsvg.Handle.render_cairo] * [method@Rsvg.Handle.render_cairo_sub]

Librsvg computes the size of the SVG being rendered, and passes it to the @size_func, which may then modify these values to set the final size of the generated image.

More...
class Handle
void
setSizeCallback

Parameters

sizeFunc RsvgSizeFunc

A sizing function, or NULL

userData void*

User data to pass to @size_func, or NULL

userDataDestroy GDestroyNotify

Function to be called to destroy the data passed in @user_data, or NULL.

Detailed Description

Deprecated: Use [method@Rsvg.Handle.render_document] instead. This function was deprecated because when the @size_func is used, it makes it unclear when the librsvg functions which call the @size_func will use the size computed originally, or the callback-specified size, or whether it refers to the whole SVG or to just a sub-element of it. It is easier, and unambiguous, to use code similar to the example above.

Meta